<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
/* --------------------------------------------------------------------------------------//
	BigDaddy Site Initialization
	Created: Duleepa Wijayawardhana, March 12, 2004
	Copyright 2004 BioWare Corp.
//--------------------------------------------------------------------------------------*/
//--------------------------------------------------------------------------------------//
error_reporting(E_ALL ^ E_NOTICE);

//Read From the Magic Constant __FILE__
preg_match("/(.*)\//i", __FILE__, $aMatches);
//Super important directory structure constants and other site specific stuff needs to be loaded
define("SITE_CONFIG", $aMatches[1]."/".$_SERVER["HTTP_HOST"]."_config.inc");
unset($aMatches);



//--------------------------------------------------------------------------------------//

//Include site specific config file
if (!file_exists(SITE_CONFIG))
{
	echo "Fatal Error: BigDaddy requires a Site Configuration file (".SITE_CONFIG."). Without this BigDaddy will not start. Sorry.";
	exit;
}
require_once(SITE_CONFIG);


//Directory where all the library files are kept.
define ("LIBDIR", "/bigdaddy/phplib");

//Constants File
require(LIBDIR."/init/constants.inc");

//--------------------------------------------------------------------------------------//
//Load the Auditing Class for any auditing
//require_once(CLASS_AUDIT);
//$Audit = new Audit;

//--------------------------------------------------------------------------------------//
//Set The Database Array and get the database functions
require_once(DB_FUNCTIONS);

//--------------------------------------------------------------------------------------//
//Initialize the session class
require_once(CLASS_FORMINPUT);
$FormInput = new FormInput();

//--------------------------------------------------------------------------------------//
//Initialize the session class
require_once(CLASS_AUDIT);
$Audit = new Audit();

//--------------------------------------------------------------------------------------//
//Initialize the sessions
require_once(SESSION_INIT);

//--------------------------------------------------------------------------------------//
//Initialize the session class
require_once(CLASS_LOGIN);


//--------------------------------------------------------------------------------------//
//Startup Session Variables
session_start();

//--------------------------------------------------------------------------------------//
//Get the role class
require_once(CLASS_ROLE);

//--------------------------------------------------------------------------------------//
//Include the core functions file
require_once(CORE_FUNCTIONS);

//--------------------------------------------------------------------------------------//
//Initialize the sessions
require_once(LOGIN_SCRIPT);


//--------------------------------------------------------------------------------------//
ob_start();

//--------------------------------------------------------------------------------------//
//Theming classes required
require_once(CLASS_CONTENT);
require_once(CLASS_APP);

$Content = new Content;
$App = new App;
?>
